import io from "socket.io-client"
import { socketUrl } from "@/config/config";
import { getSession, setLocal, getLocal } from "../utils/index";

// console.log(io);

const socket = io(socketUrl);

if(getSession('userInfo')){
  let { id } = getSession('userInfo')
  socket.on('connect', () => {
    console.log('实时socketID:',socket.id); 
    socket.emit('updSocketMap', { sender: id });
  });
}


export default socket